home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-02-17 | 1.2 KB | 40 lines | [TEXT/ToyS] |
- on run
- set R to {}
- set srcFile to choose file with prompt "Choose a res file:"
- tell application "Finder" to get name of srcFile
- set dstFile to new file with prompt "Copy to:" default name result & ".rsrc"
- set r2 to 0
- set rf to res open srcFile
- try
- try
- res create dstFile creator type "RSED" file type "rsrc"
- on error number errNum
- if errNum = -48 then
- tell application "Finder" to delete dstFile
- res create dstFile creator type "RSED" file type "rsrc"
- end if
- end try
- set r2 to res open dstFile with write permission
-
- set rTypesCount to res count types rf
- repeat with i from 1 to rTypesCount
- set rType to res get type rf index i
- --tell application "Transcript" to echo rType --as string)
- set rCount to res count rf type rType
- set R to R & [rType, rCount]
- repeat with j from 1 to rCount
- --tell application "Transcript" to echo " " & j
- res put r2 type rType id 1000 + j data (res get rf type rType index j)
- end repeat
- --tell application "Transcript" to echo return
- end repeat
- beep 1
- on error errText number errNum from offendingObjectVariable
- if r2 ≠ 0 then res close r2
- res close rf
- error errText number errNum from offendingObjectVariable
- end try
- res close r2
- res close rf
- R
- end run